package tdd.refactor;

public class BaseFee implements Chargeable{
    protected TaxiFeeModel taxiFeeModel;
       
    /**
	 * @param taxiFeeModel
	 */
	public BaseFee(TaxiFeeModel taxiFeeModel) {
		super();
		this.taxiFeeModel = taxiFeeModel;
	}
   
    public double chargeByMiles(double miles) {
		return  Math.ceil(miles) <= this.taxiFeeModel.startMiles? this.taxiFeeModel.startPrice: (Math.ceil(miles) - this.taxiFeeModel.startMiles)*this.taxiFeeModel.pricePerMile+this.taxiFeeModel.startPrice;
	}
	
}
